package com.wisnu.hibernate.entity;
// Generated Apr 4, 2014 2:59:33 PM by Hibernate Tools 3.6.0

import java.util.Date;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Ptik generated by hbm2java
 */
@Entity
@Table(name = "ptik", catalog = "example", uniqueConstraints = {
    @UniqueConstraint(columnNames = "NIM"),
    @UniqueConstraint(columnNames = "EMAIL")}
)
public class Ptik implements java.io.Serializable {

    private Integer id;
    private String nim;
    private String nama;
    private Date tanggalLahir;
    private String telepon;
    private String email;

    public Ptik() {
    }

    public Ptik(String nim, String nama) {
        this.nim = nim;
        this.nama = nama;
    }

    public Ptik(String nim, String nama, Date tanggalLahir, String telepon, String email) {
        this.nim = nim;
        this.nama = nama;
        this.tanggalLahir = tanggalLahir;
        this.telepon = telepon;
        this.email = email;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "NIM", unique = true, nullable = false, length = 10)
    public String getNim() {
        return this.nim;
    }

    public void setNim(String nim) {
        this.nim = nim;
    }

    @Column(name = "NAMA", nullable = false)
    public String getNama() {
        return this.nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "TANGGAL_LAHIR", length = 10)
    public Date getTanggalLahir() {
        return this.tanggalLahir;
    }

    public void setTanggalLahir(Date tanggalLahir) {
        this.tanggalLahir = tanggalLahir;
    }

    @Column(name = "TELEPON", length = 14)
    public String getTelepon() {
        return this.telepon;
    }

    public void setTelepon(String telepon) {
        this.telepon = telepon;
    }

    @Column(name = "EMAIL", unique = true)
    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return "Ptik{" + "id=" + id + ", nim=" + nim + ", nama=" + nama + ", tanggalLahir=" + tanggalLahir + ", telepon=" + telepon + ", email=" + email + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 67 * hash + Objects.hashCode(this.id);
        hash = 67 * hash + Objects.hashCode(this.nim);
        hash = 67 * hash + Objects.hashCode(this.nama);
        hash = 67 * hash + Objects.hashCode(this.tanggalLahir);
        hash = 67 * hash + Objects.hashCode(this.telepon);
        hash = 67 * hash + Objects.hashCode(this.email);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Ptik other = (Ptik) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        if (!Objects.equals(this.nim, other.nim)) {
            return false;
        }
        if (!Objects.equals(this.nama, other.nama)) {
            return false;
        }
        if (!Objects.equals(this.tanggalLahir, other.tanggalLahir)) {
            return false;
        }
        if (!Objects.equals(this.telepon, other.telepon)) {
            return false;
        }
        if (!Objects.equals(this.email, other.email)) {
            return false;
        }
        return true;
    }

}
